#!/bin/bash

#Auhtor:李亚坤
#Descripiton:数据接收服务-v0.0.1

#启动
start(){
	echo "启动数据接收服务..."
	nohup java -jar ./data-collect.jar &
}
#停止方法
stop(){
        ps -ef | grep data-collect | awk '{print $2}' | while read pid
        do
           kill -9 $pid
        done
}

case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
restart)
  stop
  start
  ;;
*)
  printf 'Usage: %s {start|stop|restart}\n' "$prog"
  exit 1
  ;;
esac
